package com.googlecode.cswish.struts;

import javax.servlet.FilterConfig;
import javax.servlet.ServletException;

import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.Dispatcher;

import com.googlecode.cswish.util.Functions;


public class StrutsPrepareFilter extends org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter{

	public void init(FilterConfig filterConfig) throws ServletException {
    	Functions.setBase(filterConfig.getServletContext().getContextPath());
		
		super.init(filterConfig);
	}
	
	protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) {
		filterConfig.getServletContext().setAttribute(StrutsStatics.SERVLET_DISPATCHER, dispatcher);
    }
}
